import { Navigate, Outlet } from 'react-router'

export default function AuthGuard() {
  // 简单示例：真实项目可换成 Redux / Zustand
  const token = localStorage.getItem('token')

  if (!token) return <Navigate to="/" replace />

  return <Outlet /> // 渲染子路由
}